function setAutoComplete(array){
	setTimeout(function(){
	 setAuto(array);
	 },2000);
}

function setAuto(array){
	var numParams = array.length/2;
	for (i=0; i<numParams; i++)
	{
		var id = array[2*i];
		var cookieName = array[2*i+1];
		var cookieValues = getCookie(cookieName).split(",");
		setAutoCompleteWithValue(id, cookieValues);
	}
}

function setAutoCompleteWithValue(id,sourceVal){
	$("#" + id).autocomplete({
		source : sourceVal
	});
}